﻿@{
    ViewBag.Title = "Thống kê";
    
}
<script type="text/javascript">
    $(document).ready(function () {
        var valueThang1 = $("#hddthang1").val();
        var phanTramthang1 = valueThang1 / 5000000000 * 200 + 'px';
        $("#thang1").css({ 'height': phanTramthang1 })

        var valueThang2 = $("#hddthang2").val();
        var phanTramthang2 = valueThang2 / 5000000000 * 200 + 'px';
        $("#thang2").css({ 'height': phanTramthang2 })

        var valueThang3 = $("#hddthang3").val();
        var phanTramthang3 = valueThang3 / 5000000000 * 200 + 'px';
        $("#thang3").css({ 'height': phanTramthang3 })

        var valueThang4 = $("#hddthang4").val();
        var phanTramthang4 = valueThang4 / 5000000000 * 200 + 'px';      
        $("#thang4").css({ 'height': phanTramthang4 })

        var valueThang5 = $("#hddthang5").val();
        var phanTramthang5 = valueThang5 / 5000000000 * 200 + 'px';
        $("#thang5").css({ 'height': phanTramthang5 })

        var valueThang6 = $("#hddthang6").val();
        var phanTramthang6 = valueThang6 / 5000000000 * 200 + 'px';
        $("#thang6").css({ 'height': phanTramthang6 })

        var valueThang7 = $("#hddthang7").val();
        var phanTramthang7 = valueThang7 / 5000000000 * 200 + 'px';
        $("#thang7").css({ 'height': phanTramthang7 })

        var valueThang8 = $("#hddthang8").val();
        var phanTramthang8 = valueThang8 / 5000000000 * 200 + 'px';
        $("#thang8").css({ 'height': phanTramthang8 })

        var valueThang9 = $("#hddthang9").val();
        var phanTramthang9 = valueThang9 / 5000000000 * 200 + 'px';
        $("#thang9").css({ 'height': phanTramthang9 })

        var valueThang10 = $("#hddthang9").val();
        var phanTramthang10 = valueThang10 / 5000000000 * 200 + 'px';
        $("#thang10").css({ 'height': phanTramthang10 });

        var valueThang11 = $("#hddthang9").val();
        var phanTramthang11 = valueThang11 / 5000000000 * 200 + 'px';
        $("#thang11").css({ 'height': phanTramthang11 });

        var valueThang12 = $("#hddthang12").val();
        var phanTramthang12 = valueThang12 / 5000000000 * 200 + 'px';
        $("#thang12").css({ 'height': phanTramthang12 });
    });

</script>
<input type="hidden" value="@ViewBag.thang1" id="hddthang1"/>
<input type="hidden" value="@ViewBag.thang2" id="hddthang2"/>
<input type="hidden" value="@ViewBag.thang3" id="hddthang3"/>
<input type="hidden" value="@ViewBag.thang4" id="hddthang4"/>
<input type="hidden" value="@ViewBag.thang5" id="hddthang5"/>
<input type="hidden" value="@ViewBag.thang6" id="hddthang6"/>
<input type="hidden" value="@ViewBag.thang7" id="hddthang7"/>
<input type="hidden" value="@ViewBag.thang8" id="hddthang8"/>
<input type="hidden" value="@ViewBag.thang9" id="hddthang9"/>
<input type="hidden" value="@ViewBag.thang10" id="hddthang10"/>
<input type="hidden" value="@ViewBag.thang11" id="hddthang11"/>
<input type="hidden" value="@ViewBag.thang12" id="hddthang12"/>
<table class="ms-table-thongke" style="height: 300px">
    <tr>
        <td colspan="12">
            <div style="text-align: center">
                <span style="font-size: 18pt; font-weight: bold">Thống kê năm @DateTime.Now.Year</span>
            </div>
        </td>
    </tr>
    <tr style="border-bottom: 1px solid #d4d4d4;">
        <td style="vertical-align: bottom">
            @{var thang1 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang1);}
            <span style="font-weight:bold">@thang1</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang1"></div>
        </td>
        <td style="vertical-align: bottom">
             @{var thang2 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang2);}
            <span style="font-weight:bold">@thang1</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang2"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang3 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang3);}
            <span style="font-weight:bold">@thang3</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang3"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang4 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang4);}
            <span style="font-weight:bold">@thang4</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang4"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang5 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang5);}
            <span style="font-weight:bold">@thang5</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang5"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang6 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang6);}
            <span style="font-weight:bold">@thang6</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang6"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang7 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang7);}
            <span style="font-weight:bold">@thang7</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang7"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang8 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang8);}
            <span style="font-weight:bold">@thang8</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang8"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang9 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang9);}
            <span style="font-weight:bold">@thang9</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang9"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang10 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang10);}
            <span style="font-weight:bold">@thang10</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang10"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang11 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang11);}
            <span style="font-weight:bold">@thang11</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang11"></div>
        </td>
        <td style="vertical-align: bottom">
            @{var thang12 = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(@ViewBag.thang12);}
            <span style="font-weight:bold">@thang12</span><div style="width: 60px; background: linear-gradient(to right, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%)" id="thang12"></div>
        </td>
    </tr>
    <tr>
        <td class="editor-label">
            <span>Tháng 1</span>
        </td>
        <td class="editor-label">
            <span>Tháng 2</span>
        </td>
        <td class="editor-label">
            <span>Tháng 3</span>
        </td>
        <td class="editor-label">
            <span>Tháng 4</span>
        </td>
        <td class="editor-label">
            <span>Tháng 5</span>
        </td>
        <td class="editor-label">
            <span>Tháng 6</span>
        </td>
        <td class="editor-label">
            <span>Tháng 7</span>
        </td>
        <td class="editor-label">
            <span>Tháng 8</span>
        </td>
        <td class="editor-label">
            <span>Tháng 9</span>
        </td>
        <td class="editor-label">
            <span>Tháng 10</span>
        </td>
        <td class="editor-label">
            <span>Tháng 11</span>
        </td>
        <td class="editor-label">
            <span>Tháng 12</span>
        </td>

    </tr>
</table>
<table>
    <tr>
        <td>
            <div style="text-align: center">
                <span style="font-size: 18pt; font-weight: bold">Thống kê hóa đơn xuất kho trong ngày : @DateTime.Now.ToString("dd/MM/yyyy")</span>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            <table class="ms-list-form">
                <tr>
                    <th>
                        <span>Mã hóa đơn</span>
                    </th>

                    <th>
                        <span>Khách hàng</span>
                    </th>
                    <th>
                        <span>Địa chỉ KH</span>
                    </th>
                    <th>
                        <span>NV giao dịch</span>
                    </th>

                    <th>
                        <span>Tổng thanh toán</span>
                    </th>
                    @{var currentRole = Roles.GetRolesForUser(User.Identity.Name);}
                    @if (currentRole.Contains("Administrator"))
                    {
                        <th><span>Lãi</span></th>
                    }
                </tr>
                @Html.Raw(@ViewBag.tableContent)
            </table>
        </td>

    </tr>
    <tr>
        <td style="text-align: right; padding-right: 17px; font-size: 20px">Tổng xuất kho trong ngày :<span style="font-weight: bold">@ViewBag.TongHD</span>
        </td>
    </tr>
    @if (currentRole.Contains("Administrator"))
    {
        <tr>
            <td style="text-align: right; padding-right: 17px; font-size: 20px">Tổng lãi trong ngày : <span style="font-weight: bold">@ViewBag.TongLaiToday</span>
            </td>
        </tr>
    }

    <tr>
        <td>
            <div id="thongkeToday" style="height: 400px">
            </div>
        </td>
    </tr>
</table>

